
import { ref } from "vue";

function useCounter() {
  const num = ref(0);
  const add = () => {
    num.value++;
  };
  const sub = () => {
    num.value--;
  };

  return {
    num, add, sub
  }
}

export default useCounter;